<template>
	<view>
		<view class="sousuo">
			<nx-search :selectList="selectList"  class="sn-earch-input-box" button="outside" placeholder="搜索避灾安置场所名称或地址"
				@search="doSearch()" @confirm="doSearch()" v-model="searchQuery.keyword" isSearch="true" />
		</view>
		<view class="jieguo" v-for="item in secondlist" @click="goto2(item.name)">
			<view style="font-size: 32rpx;margin-top: 32rpx;">{{item.name}}</view>
			<view style="font-size: 28rpx;margin-top: 20rpx; color: #666666;margin-bottom: 32rpx;">{{item.address}}</view>
		</view>
		<!-- <view class="jieguo" v-show="false">
			<view style="font-size: 32rpx;margin-top: 36rpx;">庆安社区避灾安置点</view>
			<view style="font-size: 28rpx;margin-top: 20rpx; color: #666666;margin-bottom: 32rpx;">鄞州区东胜街道大湾路104</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				active:0,
				cates:[],
				name:0,
				secondDate:[],
				keywordList:[],
				key:'',
				name:'',
				secondlist:[],
				searchQuery: {
				                    keyword: '',
				                    selectIndex: 0
				                },
				                selectList: [{
				                        id: 1,
				                        name: '鄞州区'
				                    },
				                    {
				                        id: 2,
				                        name: '海曙区'
				                    },
				                ],
			}
		},
		onLoad(options) {
			
			console.log(options);
			// this.key=options.keyword;
			// console.log(this.key);
			// this.getName();
			
		},
		methods: {
			doSearch(searchQuery,keyword) {
				
			    console.log('searchQuery', searchQuery);
				this.key=searchQuery.keyword
				console.log(this.key);
				this.$myRequest({
					url:'/inspect/v1/owner_flood/point',
					data:{"name": this.key,"point":""}
				}).then((res)=>{
					console.log(res);
					this.secondlist= res.data.data;
					
				})
			},
			goto2(name){
				console.log(name);
				uni.navigateTo({
					url:'../index/index?name='+name
				})
			}
			
		}
	}
</script>

<style>
.jieguo{
	
	width: 722rpx;
	margin-left: 28rpx;
	border-bottom: 1px solid #EFEFEF;
}
</style>
